home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 April: Mac OS SDK / Dev.CD Apr 00 SDK1.toast / Development Kits / Mac OS / Installer SDK 1.2.3 / Installer 4.0.8 / Installer 4.0.8 Examples / Script Development FAQ next >
Encoding:
Text File  |  1996-10-14  |  8.7 KB  |  212 lines  |  [ttro/ttxt]

  1. Script Development FAQ
  2.  
  3. Answers to the following Installer scripting questions, fresh from our resident Installer curmudgeon's email files:
  4.  
  5. •  If I make changes to the files I'm installing, do I need to change my Installer script?
  6. •  How do make a debug version of my Installer script?  (How do I make a Debug Log?)
  7. •  How do I check for the existence of a particular file before installation?
  8. •  I want to add a splash screen to my script.  What are the dimensions for the splash screen?
  9. •  Should I install my application as FAT, rather than PPC or 68K (depending on machine type) on Easy Install?
  10. •  What do I have to watch out for if I'm using InstaCompOne compressed files?
  11. •  What's the scoop on InstaCompOne font compression?
  12. •  Can I put more than one font into an InstaCompOne archive?
  13.  
  14.  
  15.  
  16. Q:  If I make changes to the files I'm installing, do I need to change my Installer script?
  17.  
  18. A:  The installer script needs to change if a file gets added or deleted, 
  19. changes name, type/creator, source location on the disk set, or target 
  20. location to get installed.
  21.  
  22. Usually, the installer script does not have to be changed if a file 
  23. changes size, version number, or contents.  (You may need to rerun
  24. the ScriptCheck tool in this instance.)
  25.  
  26. The script also needs to change if a file grows a whole lot and the disks 
  27. need to be reorganized.
  28.  
  29.  
  30. Q:  How do make a debug version of my Installer script?
  31.  
  32. A:  You need the following pieces:
  33.      - your install disk set or net install
  34.      - The "Installer_Debug" application program
  35.      - The "Installer Debugger.rsrc" resource file.
  36.      - ResEdit or Resourcerer
  37.  
  38. Step 1:  Make a copy of the install script, next to the original. Call it 
  39. "<whatever> debug". Put the "Installer_Debug" application next to the 
  40. regular installer.
  41.  
  42. Step 2: Use ResEdit or Resourcerer to open this copy and the "Installer 
  43. Debugger.rsrc" file.
  44.  
  45. Step 3: Copy all the resources from the "Installer Debugger.rsrc" file to 
  46. the "<whatever> debug" install script file.
  47.  
  48. Step 4: Save, close, quit.
  49.  
  50. Step 5: THE FIRST TIME YOU RUN THE DEBUG INSTALLER on a particular 
  51. System, you'll need to set up the preferences. Here's how:
  52.     a) Drag your "<whatever> debug" install script onto the 
  53. "Installer_Debugger" app.
  54.     b) Click "Continue" in the splash screen window.
  55.     c) Click in the "Wasabi Debugger" window to bring it to the front.
  56.     d) Select "Preferences" from the "Wasabi" menu.
  57.     e) Click on ALL the checkboxes EXCEPT "Break On Quit", "Open Rule 
  58. Window", and "Open Heap Window".
  59.     f) Select "Quit" from the "Wasabi" menu.
  60.  
  61. NOW YOU'RE READY TO MAKE A DEBUG LOG:
  62.  
  63. Step 6: Drag your "<whatever> debug" install script onto the 
  64. "Installer_Debugger" app.
  65.  
  66. Step 7: Click "GO" in the "Wasabi Debugger" window. (This will take a 
  67. moment.)
  68.  
  69. Step 8: If the disk you want to install onto is not already selected in 
  70. the installer main window, select it now. (This will take a moment.)
  71.  
  72. Step 9: Select Easy or Custom install as needed.
  73.  
  74. Step 10: Select Custom Options, if needed.
  75.  
  76. Step 11: Click "Install."
  77.  
  78. Step 12: Proceed with the install as normal. If all goes well, the debug 
  79. installer will exhibit the same behavior as the non-debug one.
  80.  
  81. Step 13: After the install finishes (or fails), dismiss any dialogs and 
  82. click "Quit" in the installer main window.
  83.  
  84. Step 14: Next to the installer script will be a file, "Wasabi Debugger 
  85. Log File". This is the Log File you want.
  86.  
  87.  
  88. Q:  Before installation, I need to check for the existence of a particular file,
  89. and stop the installation if it is found.  How do I do this?
  90.  
  91. A:  If the file's name is not localized, you can do this with 
  92. CheckFileRsrcForkExists and a regular intf.
  93.  
  94. If the name changes in different countries, you can do this with 
  95. CheckFileRsrcForkExists and an intf which includes a search procedure 
  96. that searches by type and creator and NOT name.
  97.  
  98. If you do find it, you need to put up an error that explains the problem 
  99. so the user can understand what to do: ReportVolError("Installation 
  100. cannot continue because it appears that <the offending file> is installed on 
  101. the disk "^0"\nPlease remove <the offending file> before installing this 
  102. software.")
  103.  
  104. Note that ReportVolError does not work correctly in the Global rules 
  105. framework, only the Easy framework and the Custom framework. So check
  106. for it in the Global framework, assert its existence, then check the assertion
  107. in Easy or  Custom or both.
  108.  
  109.  
  110. Q:  I want to add a splash screen to my script.  What are the dimensions for the splash screen?
  111.  
  112. A:  This information is in the Installer Technical Guide, under the section 
  113. "Adding a Splash Screen."
  114.  
  115. You need to make two PICT resources, max size 433x220 pixels. One must be 
  116. black-and-white. The other should be 8 bit per pixel "system palette" 
  117. color.
  118.  
  119. It's suggested to use Garamond 18pt and 14pt, but whatever is on your 
  120. packaging is probably optimal. NOTE that all fonts must be converted to 
  121. bitmap. Otherwise your Ziggacious Bold font will be conveniently turned 
  122. into Geneva Jaggie.
  123.  
  124.  
  125. Q:  Should I install my application as FAT, rather than PPC or 68K (depending on machine type) on Easy Install?
  126.  
  127. A:  The usual way this is handled:
  128.  
  129. Easy install installs fat apps all the time.
  130.  
  131. Custom install has an option that says Fat Install with sub-options for 
  132. PPC-only and 68K-only installs. (This custom install is complex and takes 
  133. quite a bit of extra installer script work.  See the "Install App Fat/PPC/68K"
  134. script example.)
  135.  
  136. This way is documented in the Installer 4.0.3 SDK as being the standard.
  137.  
  138. Rationale:
  139.  
  140. Asking the user during an Easy install is an HI no-no. A script deciding 
  141. without user intervention is very likely to do the wrong thing. 
  142.  
  143. Now there are some machines we KNOW cannot be 68K, and some we know 
  144. cannot be PPC, but if you install onto an external drive, you might take 
  145. the drive to another machine. Or the "drive" might be a powerbook in SCSI 
  146. disk mode. Or you might have a machine you can't tell about: a Q950 might 
  147. have a PPC upgrade card in it.
  148.  
  149. Suggestion:
  150.  
  151. I would suggest following the usual way, except for one potential 
  152. problem: if the custom install options vary across system versions, 
  153. tri-mode installation (68k, ppc, fat) could make the number of 
  154. installation packages gigantic. This impacts scriptwriter, testers, and 
  155. perhaps users (could slow down custom install window refresh).
  156.  
  157.  
  158. Q:  What do I have to watch out for if I'm using InstaCompOne compressed files?
  159.  
  160. A:  If you are using compressed files, and you use "useScrCrDateToCompare" 
  161. in your infa's, the Installer will use the creation date of the 
  162. compressed file -- not the original file -- as its comparison date. 
  163. Therefore, if you are using compressed files, you will always want to 
  164. compare by version number, by using "useVersProcToCompare" instead. The 
  165. default version procedure (indicated by putting 0 in the compare function 
  166. field) should be sufficient for all but cases except system enablers.
  167.  
  168.  
  169. Q:  What's the scoop on InstaCompOne font compression?
  170.  
  171. A:  Fonts are compressed in a different way than regular files.
  172.  
  173. Regular files are compressed as entire files into a FILE archive (tome). 
  174. The files are all jammed into the data fork of the archive. During 
  175. installation, the files are decompressed and installed as entire files.
  176.  
  177. Fonts are compressed by making a RESOURCE archive. Individual font 
  178. resources of type sfnt are compressed into the resource fork of the tome. 
  179. During the compression, their type is changed to part and their id is 
  180. reassigned based on a wacky algorithm. A tool called FONDinfoWS does this 
  181. translation. It generates the command lines to InstaCompOne that compress 
  182. the sfnts.
  183.  
  184. Now, FOND resources are not compressed, just copied into the resource 
  185. fork of the tome, however, they are changed from type FOND to type iFND.
  186.  
  187. During installation, the installer does about 999 magic tricks to install 
  188. the fonts from the individual resources into the correct font suitcases, 
  189. but that's an entirely other story.
  190.  
  191.  
  192. Q:  Can I put more than one font into an InstaCompOne archive?
  193.  
  194. A:  It is not recommeded to put more than one font into an InstaCompOne
  195. archive.  There is a possibility that their IDs may overlap and create havoc.
  196.  
  197. 1) Due to the way that the Installer compresses fonts, FONDs with the 
  198. same ID# cannot be put in the same archive.  (Also, in the past, all 
  199. FONDs were required to have unique IDs. Not any more.)  The Finder
  200. renumbers FONDs as needed.
  201.  
  202. 2) This issue is different than sfnt ID#'s. No one even pretends to 
  203. require sfnt's to have unique IDs. So the installer font compressor 
  204. assistant (FONDinfoWS, which teams up with InstaCompOne to compress 
  205. fonts) assigns a supposedly-unique "part number" for each sfnt. 
  206. Ufortunately, that "unique" ID is not very unique.
  207.  
  208. Neither of these two problems affects how fonts look.
  209.  
  210. The only way that there's a problem is that if some parts or FONDs have 
  211. the same ID, the same font strike will show up for two different fonts. 
  212.